﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace NetRosApp.PravaPart.Views.DjelatniciView
{
    public partial class NoviDjelatnik : DevExpress.XtraEditors.XtraForm
    {
      
        public NoviDjelatnik()
        {
            InitializeComponent();
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            textEdit1.DoValidate();
            textEdit2.DoValidate();
            textEdit3.DoValidate();
            lookUpEdit1.DoValidate();
            if (this.ValidateChildren() && this.Validate())
            {
                DialogResult = DialogResult.Yes;
                this.Close();
            }
        }

        private void textEdit1_Validating(object sender, CancelEventArgs e)
        {
            BaseEdit _edit = sender as BaseEdit;
            if (_edit != null && !String.IsNullOrEmpty(Convert.ToString(_edit.EditValue)))
            {
                e.Cancel = false;
            }
            else
            {
                e.Cancel = true;
            }
        }
    }
}